package zy.test.sqlite;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class SQLiteUseActivity extends Activity {

	
	
	EditText t1,t2;
	Button b1;
	UserUtil userUtil;
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        t1=(EditText)findViewById(R.id.editText1);
        t2=(EditText)findViewById(R.id.editText2);
        b1=(Button)findViewById(R.id.button1);
        userUtil=new UserUtil(this);
        b1.setOnClickListener(new OnClickListener()
        {
			@Override
			public void onClick(View v) {
				ProgressDialog ps=new ProgressDialog(SQLiteUseActivity.this);
				ps.show();
				userUtil.add(new User(t1.getEditableText().toString(),Double.parseDouble(t2.getEditableText().toString())));
				ps.dismiss();
			}
        	
        });
    }
}